﻿using DTOs;
using MediatR;
using RBAC.Domain;
using RBAC.Domain.Service.Interfae;
using RBACDuYaJun.Api.Appliction.Command.MenuCommand;

namespace RBACDuYaJun.Api.Appliction.CommandHandlers.MenuHanders
{
    public class MenuShowCommandHandler : IRequestHandler<MenuShowCommand, PageDto<MenuDTOs>>
    {
        private readonly IMenuService _menuService;
        public MenuShowCommandHandler(IMenuService menuService)
        {
            _menuService = menuService;
        }

        public async Task<PageDto<MenuDTOs>> Handle(MenuShowCommand request, CancellationToken cancellationToken)
        {
            return await _menuService.GetMenusUserId(request.uid,request.pageSize,request.pageIndex);
        }
    }
}
